package com.bsoft.client.controller;

import com.bsoft.client.annotation.RpcAutowired;
import com.bsoft.core.api.OrgService;
import com.bsoft.core.bean.OrgInfo;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("org")
public class OrgController {

    @RpcAutowired
    OrgService orgService;

    @GetMapping()
    public OrgInfo getById(int orgId) {
        return orgService.getById(orgId);
    }

    @GetMapping("getOrgName")
    public String getOrgNameById(int orgId) {
        return orgService.getOrgNameById(orgId);
    }

    @PostMapping("queryOrg")
    public List<OrgInfo> queryOrg(@RequestBody OrgInfo orgInfo) {
        return orgService.queryOrg(orgInfo);
    }
}
